from starlette.responses import HTMLResponse
app = FastAPI()
html0='''
<html>
<body>
{}
</body>
</html>
'''

@app.get("/")
def frame0():
    list1=[]
    for i in range(10):
        list1.append('<p>'+str(i)+'</p>')
    html1=html0.format('\n'.join(list1))
    return HTMLResponse(content=html1)